<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    for(var i = 1000; i <= 9999; i++){
        // 把i这个四位数的每一位数分别取出来
        var q = parseInt(i / 1000) //求出千位的值
        var b = parseInt(i % 1000 / 100) //求出百位的值
        var s = parseInt(i % 100 / 10)  ////求出十位的值
        var g = i % 10  ////求出个位的值
        if(i === q*q*q*q + b*b*b*b + s*s*s*s + g*g*g*g){
            console.log(i + "是四叶玫瑰")
        }
    }
</script>
</html>